package com.jessechanrui.template.ofdrw;

import org.ofdrw.layout.OFDDoc;
import org.ofdrw.layout.element.Paragraph;

import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.nio.file.Paths;

/**
 * @author chenrui
 * @date 2025/11/18
 * @description:
 */
public class Main {
    public static void main(String[] args) throws IOException {

        System.out.println("Hello world!");
        Path path = Paths.get(new File(FileUtil.getOutDir(),"HelloWorld.ofd").getAbsolutePath());
        try (OFDDoc ofdDoc = new OFDDoc(path)) {
            Paragraph p = new Paragraph("你好呀，OFD Reader&Writer！");
            ofdDoc.add(p);
        }
        System.out.println("生成文档位置: " + path.toAbsolutePath());
    }
}